package cn.ljy.quicksnip.utils.token;

import org.springframework.util.StringUtils;

import javax.servlet.http.HttpServletRequest;

/**
 * token的工具类
 */
public class SchoolTokenUtil {
    /**
     * 根据header或参数中获取token
     * @return token
     */
    public static String getSchoolStudentToken(HttpServletRequest request) {
        String token = request.getHeader("student_access_token");//读取token的值
        if (!StringUtils.hasLength(token)) {
            token = request.getParameter("student_access_token");
        }
        return token;
    }
}
